<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>随访记录</title>
	<%- include('../_global/baseLibsJKDA') %>
    <link rel="stylesheet" href="/static/css/public.css"/>
    <link rel="stylesheet" href="/static/css/page-main.css"/>
    <!--<link rel="stylesheet" href="/static/css/public.css">-->
    <style type="text/css">
    html,body {
        width: 100%;
        height: 100%;
        margin: 0px;
        background-color: white;
    }
    #ListTabBox .tab{ display: block!important;}
    .bg_white{
        background: #fff;
    }
	.detail .list{
		border-bottom: 1px solid #eee;
	}
   .detail li{
        padding: 0.3rem 0;
        font-size: 0.95238rem;
        margin: 0 0.95238rem;
        
    }
    </style>
</head>
<body>
	<header class="header-box grey fixed">
			<div class="header-content">
				<div class="left-tool">
					<a class="back" href="javascript:void(0);"><i class="iconfont icon-back"></i></a>
				</div>
				<div class="title">随访记录</div>
			</div>
	</header>
    <div class="tab-box">
		<span class="gray-line"></span>
		<ul id="ListTab">
			<li class="active" value="gxy" ><a>高血压记录</a></li>
			<li value="tnb"><a>糖尿病记录</a></li>
		</ul>
	</div>
	<div id="ListTabBox bg_white">
			<ul class="detail" >
				<li class="b-box" id="gxy" style="border-bottom: 0px;">
					<div id="gxysf"> </div>
				</li>
				<li class="b-box" id="tnb" style="border-bottom: 0px;">
					<div id="tnbsf"> </div>
				</li>
			</ul>
	</div>
	
</body> 
<script type="text/javascript">

    var page_sfjl = (function($, page_sfjl) {

        var zxwyh =$.QuickUrlUtils.getRequest("ZXWYH");
        var cfg_def = {
            indataGXY: indataGXY,
            indataTNB: indataTNB,
            gxyData: gxyData,
            tnbData: tnbData,
        }

        page_sfjl.init = function(cfg){
            $.extend(page_sfjl, cfg_def, cfg);
            page_sfjl.indataGXY();
            page_sfjl.indataTNB();
            $("#tnb").hide();

            /**选择高血压或者糖尿病*/
            $("#ListTab").on("click","li",function(){
                $(this).addClass('active').siblings("li").removeClass("active");
                var value = $(this).attr("value");
                if(value == "gxy"){
                    $("#gxy").show();
                    $("#tnb").hide();

                }else{
                    $("#gxy").hide();
                    $("#tnb").show();
                }
            });
        }

        return page_sfjl;

        function indataGXY(){
            //查询高血压
            $.QuickRemote.AjaxJson({
                funcName: "/api/gzd/jkda/getHDEPDataService"
                ,callback:page_sfjl.gxyData
                ,params:{
                    "zxwyh": zxwyh,
                }
            });
        }
        function indataTNB(){
            //查询糖尿病
            $.QuickRemote.AjaxJson({
                funcName: "/api/gzd/jkda/getDabetesDataService"
                ,callback:page_sfjl.tnbData
                ,params:{
                    "zxwyh": zxwyh,
                }
            });
        }
        function gxyData(response){
            $("#gxysf").html(template("gxyList", {data:response}));
        }
        function tnbData(response){
            $("#tnbsf").html(template("tnbList", {data:response}));
        }
    })(jQuery, {});
	

</script>
<script type="text/html" id="gxyList">
    {{each data}}
	<div class="list">
		<li>随访日期：{{$value.sfrq}}</li>
		<li>收缩压：{{$value.ssy}}</li>
		<li>舒张压：{{$value.szy}}</li>
	</div>
    {{/each}}
</script>
<script type="text/html" id="tnbList">
    {{each data}}
	<div class="list">
		<li>随访日期：{{$value.sfrq}}</li>
		<li>空腹血糖：{{$value.kfxt}}</li>
		<li>随机血糖：{{$value.sjxt}}</li>
		<li>餐后2h血糖：{{$value.ch}}</li>
	</div>
    {{/each}}
</script>
</html>